﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;

namespace IDE_Week2
{
    public partial class Form1 : Form
    {
        Form2 f2 = new Form2();
        int langID = 0;

        public Form1()
        {
            InitializeComponent();
        }

        private void newformButton_Click(object sender, EventArgs e)
        {
            f2.Show();
        }

        private void changeiconButton_Click(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.ICON2;
            f2.Icon = Properties.Resources.ICON1;
        }

        private void reseticonButton_Click(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.ICON1;
            f2.Icon = Properties.Resources.ICON2;
        }

        private void languageButton_Click(object sender, EventArgs e)
        {
            if (langID == 0)
            {
                ChangeLanguage("hu");
                langID = 1;
            }
            else
            {
                ChangeLanguage("en");
                langID = 0;
            }
        }

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void callclassButton_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
        }

    }
}
